export function searchColumns() {
  return [
    {
      prop: 'channel',
      placeholder: '请输入渠道',
    },
    {
      prop: 'dateRange',
      type: 'daterange',
    },
  ]
}

export function tableColumns() {
  return [
    {
      width: 140,
      label: '日期',
      prop: 'date',
      formatter: row => this.$formatTime(row?.date),
    },
    {
      label: '渠道',
      prop: 'channel',
    },
    {
      label: '国家',
      prop: 'country_name',
    },
    {
      align: 'right',
      label: '用户数',
      prop: 'user_count',
    },
    {
      label: '用户付费率',
      prop: 'pay_user_count',
      formatter: row =>
        `${
          isFinite(row?.pay_user_count / row?.user_count)
            ? 0
            : (row?.pay_user_count / row?.user_count) * 100
        }%`,
    },
  ]
}
